home *** CD-ROM | disk | FTP | other *** search
/ C++ für Kids / C++ for kids.iso / SETUP / US / CBUILDER / DATA.Z / FILECTRL.HPP < prev    next >
C/C++ Source or Header  |  1997-02-13  |  15KB  |  421 lines

  1. //----------------------------------------------------------------------------
  2. // FileCtrl.hpp - bcbdcc32 generated hdr (DO NOT EDIT) rev: 0
  3. // From: FileCtrl.pas
  4. //----------------------------------------------------------------------------
  5. #ifndef FileCtrlHPP
  6. #define FileCtrlHPP
  7. //----------------------------------------------------------------------------
  8. #include <Buttons.hpp>
  9. #include <StdCtrls.hpp>
  10. #include <Menus.hpp>
  11. #include <Forms.hpp>
  12. #include <Graphics.hpp>
  13. #include <Controls.hpp>
  14. #include <Classes.hpp>
  15. #include <SysUtils.hpp>
  16. #include <Messages.hpp>
  17. #include <Windows.hpp>
  18. #include <System.hpp>
  19. #pragma warn -par
  20. #pragma warn -hid 
  21. #pragma warn -inl
  22.  
  23. namespace Filectrl
  24. {
  25. //-- type declarations -------------------------------------------------------
  26. enum TFileAttr { ftReadOnly, ftHidden, ftSystem, ftVolumeID, ftDirectory, ftArchive, ftNormal };
  27.  
  28. typedef Set<TFileAttr, ftReadOnly, ftNormal>  TFileType;
  29.  
  30. enum TDriveType { dtUnknown, dtNoDrive, dtFloppy, dtFixed, dtNetwork, dtCDROM, dtRAM };
  31.  
  32. class __declspec(delphiclass) TFileListBox;
  33. class __declspec(delphiclass) TDirectoryListBox;
  34. class __declspec(delphiclass) TDriveComboBox;
  35. enum TTextCase { tcLowerCase, tcUpperCase };
  36.  
  37. class __declspec(pascalimplementation) TDriveComboBox : public Stdctrls::TCustomComboBox
  38. {
  39.     typedef Stdctrls::TCustomComboBox inherited;
  40.     
  41. private:
  42.     TDirectoryListBox* FDirList;
  43.     char FDrive;
  44.     TTextCase FTextCase;
  45.     void __fastcall SetDirListBox(TDirectoryListBox* Value);
  46.     HIDESBASE MESSAGE void __fastcall CMFontChanged(Messages::TMessage &Message);
  47.     void __fastcall SetDrive(char NewDrive);
  48.     void __fastcall SetTextCase(TTextCase NewTextCase);
  49.     void __fastcall ReadBitmaps(void);
  50.     void __fastcall ResetItemHeight(void);
  51.     
  52. protected:
  53.     Graphics::TBitmap* FloppyBMP;
  54.     Graphics::TBitmap* FixedBMP;
  55.     Graphics::TBitmap* NetworkBMP;
  56.     Graphics::TBitmap* CDROMBMP;
  57.     Graphics::TBitmap* RAMBMP;
  58.     Classes::TNotifyEvent FOnChange;
  59.     virtual void __fastcall CreateWnd(void);
  60.     virtual void __fastcall DrawItem(int Index, const Windows::TRect &Rect, Stdctrls::TOwnerDrawState State
  61.         );
  62.     virtual void __fastcall Click(void);
  63.     virtual void __fastcall BuildList(void);
  64.     virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
  65.         );
  66.     HIDESBASE virtual void __fastcall Change(void);
  67.     
  68. public:
  69.     __fastcall virtual TDriveComboBox(Classes::TComponent* AOwner);
  70.     __fastcall virtual ~TDriveComboBox(void);
  71.     __property Text ;
  72.     __property char Drive = {read=FDrive, write=SetDrive, nodefault};
  73.     
  74. __published:
  75.     __property Color ;
  76.     __property Ctl3D ;
  77.     __property TDirectoryListBox* DirList = {read=FDirList, write=SetDirListBox, nodefault};
  78.     __property DragMode ;
  79.     __property DragCursor ;
  80.     __property Enabled ;
  81.     __property Font ;
  82.     __property ImeMode ;
  83.     __property ImeName ;
  84.     __property ParentColor ;
  85.     __property ParentCtl3D ;
  86.     __property ParentFont ;
  87.     __property ParentShowHint ;
  88.     __property PopupMenu ;
  89.     __property ShowHint ;
  90.     __property TabOrder ;
  91.     __property TabStop ;
  92.     __property TTextCase TextCase = {read=FTextCase, write=SetTextCase, default=0};
  93.     __property Visible ;
  94.     __property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
  95.     __property OnClick ;
  96.     __property OnDblClick ;
  97.     __property OnDragDrop ;
  98.     __property OnDragOver ;
  99.     __property OnDropDown ;
  100.     __property OnEndDrag ;
  101.     __property OnEnter ;
  102.     __property OnExit ;
  103.     __property OnKeyDown ;
  104.     __property OnKeyPress ;
  105.     __property OnKeyUp ;
  106.     __property OnStartDrag ;
  107. public:
  108.     /* TWinControl.CreateParented */ __fastcall TDriveComboBox(HWND ParentWindow) : Stdctrls::TCustomComboBox(
  109.         ParentWindow) { }
  110.     
  111. };
  112.  
  113. class __declspec(delphiclass) TFolderBitmap;
  114. class __declspec(pascalimplementation) TFolderBitmap : public Graphics::TBitmap
  115. {
  116.     typedef Graphics::TBitmap inherited;
  117.     
  118. public:
  119.     __fastcall TFolderBitmap(void);
  120. public:
  121.     /* TBitmap.Destroy */ __fastcall virtual ~TFolderBitmap(void) { }
  122.     
  123. };
  124.  
  125. class __declspec(pascalimplementation) TDirectoryListBox : public Stdctrls::TCustomListBox
  126. {
  127.     typedef Stdctrls::TCustomListBox inherited;
  128.     
  129. private:
  130.     TFileListBox* FFileList;
  131.     TDriveComboBox* FDriveCombo;
  132.     Stdctrls::TLabel* FDirLabel;
  133.     bool FInSetDir;
  134.     bool FPreserveCase;
  135.     bool FCaseSensitive;
  136.     char __fastcall GetDrive(void);
  137.     void __fastcall SetFileListBox(TFileListBox* Value);
  138.     void __fastcall SetDirLabel(Stdctrls::TLabel* Value);
  139.     void __fastcall SetDirLabelCaption(void);
  140.     HIDESBASE MESSAGE void __fastcall CMFontChanged(Messages::TMessage &Message);
  141.     void __fastcall SetDrive(char Value);
  142.     void __fastcall DriveChange(char NewDrive);
  143.     void __fastcall SetDir(const System::AnsiString NewDirectory);
  144.     virtual void __fastcall SetDirectory(const System::AnsiString NewDirectory);
  145.     void __fastcall ResetItemHeight(void);
  146.     
  147. protected:
  148.     TFolderBitmap* ClosedBMP;
  149.     TFolderBitmap* OpenedBMP;
  150.     TFolderBitmap* CurrentBMP;
  151.     System::AnsiString FDirectory;
  152.     Classes::TNotifyEvent FOnChange;
  153.     virtual void __fastcall Change(void);
  154.     virtual void __fastcall DblClick(void);
  155.     virtual void __fastcall ReadBitmaps(void);
  156.     virtual void __fastcall CreateWnd(void);
  157.     virtual void __fastcall DrawItem(int Index, const Windows::TRect &Rect, Stdctrls::TOwnerDrawState State
  158.         );
  159.     int __fastcall ReadDirectoryNames(const System::AnsiString ParentDirectory, Classes::TStringList* DirectoryList
  160.         );
  161.     virtual void __fastcall BuildList(void);
  162.     virtual void __fastcall KeyPress(char &Key);
  163.     virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
  164.         );
  165.     
  166. public:
  167.     __fastcall virtual TDirectoryListBox(Classes::TComponent* AOwner);
  168.     __fastcall virtual ~TDirectoryListBox(void);
  169.     System::AnsiString __fastcall DisplayCase(const System::AnsiString S);
  170.     int __fastcall FileCompareText(const System::AnsiString A, const System::AnsiString B);
  171.     System::AnsiString __fastcall GetItemPath(int Index);
  172.     void __fastcall OpenCurrent(void);
  173.     HIDESBASE void __fastcall Update(void);
  174.     __property char Drive = {read=GetDrive, write=SetDrive, nodefault};
  175.     __property System::AnsiString Directory = {read=FDirectory, write=SetDirectory, nodefault};
  176.     __property bool PreserveCase = {read=FPreserveCase, nodefault};
  177.     __property bool CaseSensitive = {read=FCaseSensitive, nodefault};
  178.     
  179. __published:
  180.     __property Align ;
  181.     __property Color ;
  182.     __property Columns ;
  183.     __property Ctl3D ;
  184.     __property Stdctrls::TLabel* DirLabel = {read=FDirLabel, write=SetDirLabel, nodefault};
  185.     __property DragCursor ;
  186.     __property DragMode ;
  187.     __property Enabled ;
  188.     __property TFileListBox* FileList = {read=FFileList, write=SetFileListBox, nodefault};
  189.     __property Font ;
  190.     __property ImeMode ;
  191.     __property ImeName ;
  192.     __property IntegralHeight ;
  193.     __property ItemHeight ;
  194.     __property ParentColor ;
  195.     __property ParentCtl3D ;
  196.     __property ParentFont ;
  197.     __property ParentShowHint ;
  198.     __property PopupMenu ;
  199.     __property ShowHint ;
  200.     __property TabOrder ;
  201.     __property TabStop ;
  202.     __property Visible ;
  203.     __property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
  204.     __property OnClick ;
  205.     __property OnDblClick ;
  206.     __property OnDragDrop ;
  207.     __property OnDragOver ;
  208.     __property OnEndDrag ;
  209.     __property OnEnter ;
  210.     __property OnExit ;
  211.     __property OnKeyDown ;
  212.     __property OnKeyPress ;
  213.     __property OnKeyUp ;
  214.     __property OnMouseDown ;
  215.     __property OnMouseMove ;
  216.     __property OnMouseUp ;
  217.     __property OnStartDrag ;
  218. public:
  219.     /* TWinControl.CreateParented */ __fastcall TDirectoryListBox(HWND ParentWindow) : Stdctrls::TCustomListBox(
  220.         ParentWindow) { }
  221.     
  222. };
  223.  
  224. class __declspec(delphiclass) TFilterComboBox;
  225. class __declspec(pascalimplementation) TFilterComboBox : public Stdctrls::TCustomComboBox
  226. {
  227.     typedef Stdctrls::TCustomComboBox inherited;
  228.     
  229. private:
  230.     System::AnsiString FFilter;
  231.     TFileListBox* FFileList;
  232.     Classes::TStringList* MaskList;
  233.     bool __fastcall IsFilterStored(void);
  234.     System::AnsiString __fastcall GetMask(void);
  235.     void __fastcall SetFilter(const System::AnsiString NewFilter);
  236.     void __fastcall SetFileListBox(TFileListBox* Value);
  237.     
  238. protected:
  239.     Classes::TNotifyEvent FOnChange;
  240.     virt